package com.chinasofti.controlconsumer.controller;

import com.chinasofti.controlcommon.common.ServerResponse;
import com.chinasofti.controlcommon.domain.dto.LoginRequDTO;
import com.chinasofti.controlconsumer.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/login")
    /*
     * get请求参数是对象数据时，feign接口需改@RequestParam为@SpringQueryMap，但是不支持feign继承,
     * 或者用@RequestParam将对象字段名都写上，支持feign继承
     * post请求feign不影响，和spring一致@RequestBody
     * */
    public ServerResponse login(@RequestBody LoginRequDTO loginRequDTO){
          return userService.login(loginRequDTO);
    }

}
